<template>
  <div id="liuhePage" class="view">
    <game-header :caipiaoTerm='caipiaoTermCon' :caipiaoName='caipiaoName'></game-header>

    <el-tabs type="border-card" v-model="activeName" @tab-click='changeTab'>
      <el-tab-pane v-for="item in gameArr" :label="item.backup1" :key="item.order" :name="item.order">
        <el-tabs v-model="activeName2">
          <el-tab-pane v-for="p in item.children" :label="p.name" :key="p.order2" :name="p.order2">
            <component :is="p.myTab" :caipiaoTerm='caipiaoTermCon' :childArr = "p" ></component>
          </el-tab-pane>
        </el-tabs>
      </el-tab-pane>
    </el-tabs>
  </div>
</template>

<script>
  import header from '../../gamesub/header.vue'
  import nav from '../../gamesub/nav.vue'
  import ptxw from './play/ptxw'
  import tema from './play/tema'
  import lm from './play/lm'
  import txtw from './play/txtw'
  import zmtm from './play/zmtm'
  import lianxiao from './play/lianxiao'
  import lianwei from './play/lianwei'
  import zxiao from './play/zxiao'
  import wuxing from './play/wuxing'
  import playMange from '../../../../assets/js/playMange.js'
  import playCom from '../../../../assets/js/playComponent.js'

  export default {
    data () {
      return {
        caipiaoName: '六合彩',
        activeName: '0',
        activeName2: '0',
        caipiaoTerm: 1,
        caipiaoTermCon: 2123123123,
        ticketId: 20,
        gameId: 33,
        gamePersentId: 0,
        gameArr: []
      }
    },
    created () {
    	let arr = this.$store.state.allGameList
    	arr.forEach(item => {
    		if(item.ticketId === this.ticketId) {
    			this.gameArr = item.list
    		}
    	})
    	console.log(this.gameArr)
  	},
    methods: {
    	changeTab () {
    		this.activeName2 = "0"
    	}
    },
    components: {
      'game-header': header,
      'game-nav': nav,
      'my-ptxw': ptxw,
      'my-tema': tema,
      'my-lm': lm,
      'my-txtw': txtw,
      'my-zmtm': zmtm,
      'my-lianwei': lianwei,
      'my-lianxiao': lianxiao,
      'my-zxiao': zxiao,
      'my-wuxing': wuxing
    }
  }
</script>

<style lang="less">
  #liuhePage {
    /*border:1px solid #ccc;*/
    .el-tabs--border-card > .el-tabs__header .el-tabs__item.is-active {
      background-color: #f13131;
      color: white;
    }
    .content {
      background-color: #fff;
      border-bottom: 1px solid #ddd;
    }

  }
</style>
